From b65197b6a888507f68d67faa188ea78c34211954 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 19 Jan 2015 13:19:46 -0800 Subject: [PATCH] Update to rust master --- Cargo.lock | 76 +++++++++++++++------------- src/cargo/core/package.rs | 6 ++- src/cargo/lib.rs | 17 ------- src/cargo/sources/git/utils.rs | 7 ++- src/cargo/sources/registry.rs | 2 +- src/rustversion.txt | 2 +- tests/test_cargo_compile_git_deps.rs | 2 +- 7 files changed, 53 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43732bc76..68a69f076 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,40 +2,46 @@ name = "cargo" version = "0.1.0" dependencies = [ - "curl 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.6.30 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)", "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "registry 0.1.0", - "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bitflags" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "curl" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "curl-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "curl-sys" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -44,7 +50,7 @@ version = "0.6.30" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "regex 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -57,15 +63,16 @@ dependencies = [ [[package]] name = "gcc" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "git2" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libgit2-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -81,20 +88,21 @@ source = "git+https://github.com/carllerche/hamcrest-rust.git#445dc78024c7d912d2 [[package]] name = "libgit2-sys" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libssh2-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libressl-pnacl-sys" -version = "2.1.3" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "pnacl-build-helper 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnacl-build-helper 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -103,8 +111,8 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -112,7 +120,7 @@ name = "libz-sys" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -133,26 +141,26 @@ name = "miniz-sys" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-sys" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libressl-pnacl-sys 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pkg-config" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "pnacl-build-helper" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -164,13 +172,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "registry" version = "0.1.0" dependencies = [ - "curl 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustc-serialize" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -196,15 +204,15 @@ name = "time" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "toml" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -213,6 +221,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/src/cargo/core/package.rs b/src/cargo/core/package.rs index 75d85a848..7cd178f68 100644 --- a/src/cargo/core/package.rs +++ b/src/cargo/core/package.rs @@ -184,7 +184,11 @@ impl PackageSet { graph.add(pkg.get_name(), deps.as_slice()); } - let pkgs = some!(graph.sort()).iter().map(|name| { + let pkgs = match graph.sort() { + Some(pkgs) => pkgs, + None => return None, + }; + let pkgs = pkgs.iter().map(|name| { self.get(*name).clone() }).collect(); diff --git a/src/cargo/lib.rs b/src/cargo/lib.rs index 2341af8b5..baed1e5cd 100644 --- a/src/cargo/lib.rs +++ b/src/cargo/lib.rs @@ -35,23 +35,6 @@ use term::color::{BLACK, RED}; pub use util::{CargoError, CliError, CliResult, human, Config}; -macro_rules! some { - ($e:expr) => ( - match $e { - Some(e) => e, - None => return None - } - ) -} - -// Added so that the try! macro below can refer to cargo::util, while -// other external importers of this macro can use it as well. -// -// "Hygiene strikes again" - @acrichton -mod cargo { - pub use super::util; -} - pub mod core; pub mod ops; pub mod sources; diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index 8aa38e2fc..8188a70a2 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -282,7 +282,7 @@ impl<'a> GitCheckout<'a> { fn reset(&self) -> CargoResult<()> { info!("reset {} to {}", self.repo.path().display(), self.revision); let object = try!(self.repo.find_object(self.revision.0, None)); - try!(self.repo.reset(&object, git2::ResetType::Hard, None, None)); + try!(self.repo.reset(&object, git2::ResetType::Hard, None, None, None)); Ok(()) } @@ -333,7 +333,7 @@ impl<'a> GitCheckout<'a> { })); let obj = try!(repo.find_object(head, None)); - try!(repo.reset(&obj, git2::ResetType::Hard, None, None)); + try!(repo.reset(&obj, git2::ResetType::Hard, None, None, None)); try!(update_submodules(&repo)); } Ok(()) @@ -365,8 +365,7 @@ fn with_authentication(url: &str, cfg: &git2::Config, mut f: F) let mut cred_helper = git2::CredentialHelper::new(url); cred_helper.config(cfg); let mut cred_error = false; - let ret = f(&mut |&mut: url, username, allowed| { - let username = if username.is_empty() {None} else {Some(username)}; + let ret = f(&mut |url, username, allowed| { let creds = if allowed.contains(git2::SSH_KEY) { let user = username.map(|s| s.to_string()) .or_else(|| cred_helper.username.clone()) diff --git a/src/cargo/sources/registry.rs b/src/cargo/sources/registry.rs index 392d5e78f..3652da4a3 100644 --- a/src/cargo/sources/registry.rs +++ b/src/cargo/sources/registry.rs @@ -451,7 +451,7 @@ impl<'a, 'b> RegistrySource<'a, 'b> { let oid = try!(repo.refname_to_id(reference)); log!(5, "[{}] updating to rev {}", self.source_id, oid); let object = try!(repo.find_object(oid, None)); - try!(repo.reset(&object, git2::ResetType::Hard, None, None)); + try!(repo.reset(&object, git2::ResetType::Hard, None, None, None)); self.updated = true; self.cache.clear(); Ok(()) diff --git a/src/rustversion.txt b/src/rustversion.txt index 2d05711ac..428e67a0a 100644 --- a/src/rustversion.txt +++ b/src/rustversion.txt @@ -1 +1 @@ -2015-01-13 +2015-01-18 diff --git a/tests/test_cargo_compile_git_deps.rs b/tests/test_cargo_compile_git_deps.rs index f9bfedeba..422f43990 100644 --- a/tests/test_cargo_compile_git_deps.rs +++ b/tests/test_cargo_compile_git_deps.rs @@ -993,7 +993,7 @@ test!(dep_with_changed_submodule { origin.save().unwrap(); let id = subrepo.refname_to_id("refs/remotes/origin/master").unwrap(); let obj = subrepo.find_object(id, None).unwrap(); - subrepo.reset(&obj, git2::ResetType::Hard, None, None).unwrap(); + subrepo.reset(&obj, git2::ResetType::Hard, None, None, None).unwrap(); } sub.add_to_index(true).unwrap(); add(&repo); -- 2.30.2